package com.lizhe.helloword.model;

import com.fasterxml.jackson.annotation.*;

import java.util.Date;
import java.util.List;

/**
 * 类描述: 序列号json的类
 *
 * @author Administrator
 * @create 2021-10-25 20:50
 */

@JsonPropertyOrder(value = {"jsonDescription", "jsonTitle"})
public class JsonTemplate {
    // 序列化忽略
    @JsonIgnore
    private Long id;
    // 别名
    @JsonProperty("title")
    private String jsonTitle;
    private String jsonDescription;

    // @JsonInclude(JsonInclude.Include.NON_NULL) 排除为空的元素不做序列化反序列化
    // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") 指定日期类型的属性格式
    @JsonInclude(JsonInclude.Include.NON_NULL)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    private List<SubJson> subJsons;


    @Override
    public String toString() {
        return "JsonTemplate{" +
                "id=" + id +
                ", jsonTitle='" + jsonTitle + '\'' +
                ", jsonDescription='" + jsonDescription + '\'' +
                ", createTime=" + createTime +
                ", subJsons=" + subJsons +
                '}';
    }

    public String getJsonTitle() {
        return jsonTitle;
    }

    public void setJsonTitle(String jsonTitle) {
        this.jsonTitle = jsonTitle;
    }

    public String getJsonDescription() {
        return jsonDescription;
    }

    public void setJsonDescription(String jsonDescription) {
        this.jsonDescription = jsonDescription;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public List<SubJson> getSubJsons() {
        return subJsons;
    }

    public void setSubJsons(List<SubJson> subJsons) {
        this.subJsons = subJsons;
    }
}